<link rel="Stylesheet" href="<?php echo base_url();?>assets/css/general.css" />
<link rel="Stylesheet" href="<?php echo base_url();?>assets/css/common.css" />
<link rel="Stylesheet" href="<?php echo base_url();?>assets/css/sk.css">
<script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/asynch.js"></script>

<div class="div_box">
    <div class="box_title" id="box_title">
        <span>Home \ SK Officials</span>
    </div>
    <div class="box_body">
        <br/>
        <span class="article_title">SK Officials</span>
    </div>
    <br/>
    <table align="center" class="box_captain">
        <tr>
            <td> 
                <center id="cap_image">

                </center>
             </td>
        </tr>
        <tr>
            <td> 
                <center class="ofcl_name" id="cap_name"></center>
            </td>
        </tr>
         <tr>
            <td style="border-top: 1px solid #999999;"> 
                <center class="ofcl_position"> SK Chairman</center>
            </td>
        </tr>
         <?php if($this->session->userdata('user_resp') == 'admin') { ?>
        <tr>
            <td style="padding-left:12em; ">
                <span id="edit"></span>
            </td>
        </tr>
         <?php } ?>
     </table>
  
        <br/> <br/>
        <span class="councilor_header">SK Councilors</span>
        <div class="box_councilor">
             <br/>
              <?php 
                foreach($data_coun as $row) {
                ?> 
             <div class="councilor">
                <table align="center">
                        <td> 
                            <center id="img_coun"> 
                                 <img class="cap_image" src="<?php echo base_url();?>uploads/officials/sk/councilors/<?php echo $row->official_photo_path; ?>"/>
                            </center>
            
                        </td>
                    </tr>
                    <tr>
                        <td> 
                            <center class="ofcl_name" id="coun_name"><?php echo $row->official_firstname .'&nbsp'.$row->official_middlename.'&nbsp'.$row->official_lastname?></center>
                        </td>
                    </tr>
                     <tr>
                        <td style="border-top: 1px solid #999999;"> 
                            <center class="ofcl_position"> SK Councilor</center>
                        </td>
                    </tr>
                     <?php if($this->session->userdata('user_resp') == 'admin') { ?>
                        <tr>
                            <td style="padding-left:12em; ">
                                <span>
                                    <a class='edit_link' href='sk/edit_ofcl?id=<?php echo $row->official_id_pk ?>'>edit</a>
                                </span>
                            </td>
                        </tr>
                         <?php } ?>
                </table>
                 
            </div> 
             <?php } ?>
         </div>
        <div style="clear: both; border-bottom: 1px solid #aaaaaa;"></div>
        <div class="box_sec_tre">
            <div class="councilor">
                    <table align="center">
                            <td> 
                            <center id="img_sec">   </center>
                            </td>
                        </tr>
                        <tr>
                            <td> 
                                <center><span class="ofcl_name" id="ofcl_sec"></span></center>
                            </td>
                        </tr>
                         <tr>
                            <td style="border-top: 1px solid #999999;"> 
                                <center class="ofcl_position"> SK Secretary</center>
                            </td>
                        </tr>
                         <?php if($this->session->userdata('user_resp') == 'admin') { ?>
                        <tr>
                            <td style="padding-left:12em; ">
                                <span id="edit_sec"></span>
                            </td>
                        </tr>
                         <?php } ?>
                    </table>
                </div> 
               
            <div class="councilor" style="margin-left: 5em;">
                    <table align="center">
                            <td> 
                                <center id="img_tre">   </center>
                            </td>
                        </tr>
                        <tr>
                            <td> 
                                <center id="ofcl_tre" class="ofcl_name"></center>
                            </td>
                        </tr>
                         <tr>
                            <td style="border-top: 1px solid #999999;"> 
                                <center class="ofcl_position"> SK Treasurer</center>
                            </td>
                        </tr>
                         <?php if($this->session->userdata('user_resp') == 'admin') { ?>
                            <tr>
                                <td style="padding-left:12em; ">
                                    <span id="edit_tre"></span>
                                </td>
                            </tr>
                             <?php } ?>
                     </table>
                </div>
            </div>
         <div style="clear: both; border-bottom: 1px solid #aaaaaa;"></div>
</div>

 <script type="text/javascript">
       $(document).ready(function() {
            var getcap = $.ajax({
                type:"post",
                url:"sk/get_cap/ajax",
                datatype:"json",
                success:function(data_cap){
                    var ja = JSON.parse(data_cap);
                    alert(data_cap);
                   var a = ja.ofcl[0].official_firstname + " &nbsp;"+ ja.ofcl[0].official_middlename  + " &nbsp;"+   ja.ofcl[0].official_lastname;
                   var b = "<img class='cap_image' src='<?php echo base_url();?>uploads/officials/sk/chairman/" + ja.ofcl[0].official_photo_path +"'/>";
                   var c = "<a class='edit_link' href='sk/edit_ofcl?id="+ ja.ofcl[0].official_id_pk +"'>edit</a>";
                      $("#cap_name").html(a);
                      $("#cap_image").html(b);
                      $("#edit").html(c);
                     
                  //  $(".article_content").html(b);
                  //  $("#breadcrumb").html(a);
                 //   $("#sitio_image").html(c);
                },
                error:function(){
                    alert("errro");
                }
            }); 
            var getsec = $.ajax({
                type:"post",
                url:"sk/get_sec/ajax",
                datatype:"json",
                success:function(data_sec){
                    var jn =JSON.parse(data_sec);
                  //  alert(data_sec);
                    var a = jn.ofcl_sec[0].official_firstname + "&nbsp;"+ jn.ofcl_sec[0].official_middlename +"&nbsp;"+ jn.ofcl_sec[0].official_lastname;
                    var b = "<img class='cap_image'id='img_sec' src='<?php echo base_url();?>uploads/officials/sk/secretary/" + jn.ofcl_sec[0].official_photo_path +"'/>";
                    var c = "<a class='edit_link' href='sk/edit_ofcl?id="+ jn.ofcl_sec[0].official_id_pk +"'>edit</a>";
                  
                    $("#ofcl_sec").html(a);
                    $("#img_sec").html(b);
                    $("#edit_sec").html(c);
                },
                error:function(){
                    alert("error ni");
                }
            });
            var gettre = $.ajax({
                type:"post",
                url:"sk/get_tre/ajax",
                datatype:"json",
                success:function(data_tre){
                    var js = JSON.parse(data_tre);
                    //alert(data_tre);
                 //   alert(js.ofcl_tre[0].official_photo_path);
                    var a = js.ofcl_tre[0].official_firstname + "&nbsp;" + js.ofcl_tre[0].official_middlename + "&nbsp;" + js.ofcl_tre[0].official_lastname;
                    var b = "<img class='cap_image'id='img_tre' src='<?php echo base_url();?>uploads/officials/sk/treasurer/" + js.ofcl_tre[0].official_photo_path +"'/>";
                    var c = "<a class='edit_link' href='sk/edit_ofcl?id="+ js.ofcl_tre[0].official_id_pk +"'>edit</a>";
                  //  alert(a);
                  //  alert(b);
                    $("#ofcl_tre").html(a);
                    $("#img_tre").html(b);
                    $("#edit_tre").html(c);
           },
               error:function(){
                   alert("error");
               }
            });
            
        });
</script>